{% extends "wagtailadmin/base.html" %}
{% load i18n wagtailadmin_tags modeladmin_tags %}

{% block titletag %}{{ view.get_meta_title }}{% endblock %}

{% block extra_css %}
    {{ block.super }}

    {% include "wagtailadmin/pages/_editor_css.html" %}
    {{ edit_handler.form.media.css }}

    {{ view.media.css }}
{% endblock %}

{% block extra_js %}
    {{ block.super }}

    {% include "wagtailadmin/pages/_editor_js.html" %}
    {{ edit_handler.form.media.js }}
    {{ edit_handler.html_declarations }}

    {{ view.media.js }}
    {% prepopulated_slugs %}
{% endblock %}

{% block content %}

    {% block header %}
        {% include "wagtailadmin/shared/header.html" with title=view.get_page_title subtitle=view.get_page_subtitle icon=view.header_icon tabbed=1 merged=1 %}
    {% endblock %}

    <form action="{% block form_action %}{{ view.create_url }}{% endblock %}"{% if is_multipart %} enctype="multipart/form-data"{% endif %} method="POST" novalidate>
        {% csrf_token %}

        {% block form %}{{ edit_handler.render_form_content }}{% endblock %}

        {% block footer %}
            <footer class="footer">
                <ul>
                    <li class="actions footer__container">
                        {% block form_actions %}
                            <div class="dropdown dropup dropdown-button match-width">
                                <button type="submit" class="button action-save button-longrunning" data-clicked-text="{% trans 'Saving…' %}">
                                    {% icon name="spinner" %}<em>{% trans 'Save' %}</em>
                                </button>
                            </div>
                        {% endblock %}
                    </li>
                </ul>
            </footer>
        {% endblock %}
    </form>
{% endblock %}
